import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:不断消除字符串中两个相邻且相同的字母
 * User: wangxin
 * Date: 2025-07-07
 * Time: 17:14
 */
public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

        String str = in.next();
        Queue<Character> q = new LinkedList<>();
        Stack<Character>s = new Stack<>();
        for(int i = 0;i < str.length();i++){
            q.offer(str.charAt(i));
        }
        while(!q.isEmpty()){
            char t = q.poll();
            if(!s.isEmpty()){
                if(t == s.peek()){
                    s.pop();
                }
            }
            s.add(t);
        }
        StringBuffer sb = new StringBuffer();
        while(!s.isEmpty()){
            sb.append(s.pop());
        }
        System.out.println(sb.reverse().toString());
    }
}
